#include<cmath>
#include <iomanip>
#include <iostream>
#include <string>
using namespace std;
int main() {
	for(string s; getline(cin, s);) {
		int sum = 1;
		if(s.at(0) >= 'a' && s.at(0) <= 'z' || s.at(0) == '_' || s.at(0) >= 'A' && s.at(0) <= 'Z') {
			for(int i = 1; i < s.length(); i++) {
				if(s.at(i) >= 'a' && s.at(i) <= 'z' || s.at(i) == '_' || s.at(i) >= 'A' && s.at(i) <= 'Z' || s.at(i) >= '0' && s.at(i) <= '9') {
					sum++;
				}
			}
			if(sum == s.length()) cout<<1<<endl;
			else cout<<0<<endl;
		} else cout<<0<<endl;
	}
	return 0;
}
